import request from "@/utils/request";

export async function list() {
    const user = JSON.parse(localStorage.getItem('user-detail') || '{}')
    if(user.tenants && user.tenants[0]){
        return request(`/AllLinks/system/config/tenant/front`, {
            method: 'GET',
        });
    }else{
        return request(`/AllLinks/system/config/front`, {
            method: 'GET',
        });
    }
}


export async function add(params: any) {
    const user = JSON.parse(localStorage.getItem('user-detail') || '{}')
    if(user.tenants && user.tenants[0]){
        return request(`/AllLinks/system/config/tenant/front`, {
            method: 'POST',
            data: params,
        });
    }else{
        return request(`/AllLinks/system/config/front`, {
            method: 'POST',
            data: params,
        })
    }
}
export async function update(params: any) {
    // return request(`/AllLinks/system/config/front`, {
    //     method: 'POST',
    //     data: params,
    // })
    const user = JSON.parse(localStorage.getItem('user-detail') || '{}')
    if(user.tenants && user.tenants[0]){
        return request(`/AllLinks/system/config/tenant/front`, {
            method: 'POST',
            data: params,
        });
    }else{
        return request(`/AllLinks/system/config/front`, {
            method: 'POST',
            data: params,
        })
    }
}
